<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let arr = [];
    for (let i = 0; i < 5; i++) {
      let x = parseFloat(prompt("请输入第" + (i + 1) + "个数："));
      arr.push(x);
    }

    function getArrMax(arr = []) {
      let max = arr[0];
      for (let i = 0; i < arr.length; i++) {
        if (max < arr[i]) {
          max = arr[i];
        }
      }
      return max;
    }

    function getArrMin(arr = []) {
      let min = arr[0];
      for (let i = 0; i < arr.length; i++) {
        if (min > arr[i]) {
          min = arr[i];
        }
      }
      return min;
    }

    alert("您输入的数分别是：" + arr + "，其中最大值是：" + getArrMax(arr) + "，其中最小值是：" + getArrMin(arr));
  </script>
</body>

</html>